import sqlite3

conn = sqlite3.connect("d:/test.db")
sqlstr = "create table user (name varchar(5) primary key, profession varchar(10), age varchar(5), hometown varchar (25))"
conn.execute(sqlstr)
print("create table successfully")

cur = conn.cursor()

sqlstr1 = "insert into user(name, profession, age, hometown)values('王哲铭', '信息工程',20,'湖北十堰') "
cur.execute(sqlstr1)

sqlstr2 = "insert into user(name, profession, age, hometown)values('肖战', '汉语言学',22,'湖北武汉') "
cur.execute(sqlstr2)

sqlstr3 = "insert into user(name, profession, age, hometown)values('蔡徐坤', '英语翻译',18,'湖北恩施') "
cur.execute(sqlstr3)

sqlstr4 = "insert into user(name, profession, age, hometown)values('王一博', '教育技术',25,'湖北仙桃') "
cur.execute(sqlstr4)

sqlstr5 = "insert into user(name, profession, age, hometown)values('罗志祥', '美容美发',16,'湖北襄阳') "
cur.execute(sqlstr5)

sqlstr6 = "insert into user(name, profession, age, hometown)values('杨幂', '表演艺术',18,'湖北黄石') "
cur.execute(sqlstr6)


conn.commit()
print("Records created successfully")
conn.close()